<?php
/**
 * Created by PhpStorm.
 * User: Emmett
 * Date: 2016/8/30
 * Time: 17:30
 */

namespace Business;


use Think\Controller;

abstract class StrategyBase
{
//    abstract protected function get_module_name();

    protected $auth_name = Array(
        '1' => 'Employee',
        '2' => 'Manager',
        '3' => 'Director',
        '99' => 'Admin',
    );
    protected $user_role = '';
    protected $mvc_controller = null;

    public function __construct($mvc_controller = null, $user_role = '')
    {
        $this->mvc_controller = $mvc_controller;
        $this->user_role = $user_role;
    }

    public function view_path($view_name = 'index')
    {
        $path = T(CONTROLLER_NAME . '/' . $this->auth_name[$this->user_role] . '/' . $view_name);
        return $path;
    }
}